﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SysMenu.aspx.cs" Inherits="Manager_SysMenu" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>系统菜单管理</title>
</head>
<body>
    <form id="form1" runat="server">
        <ext:PageManager ID="PageManage" AjaxLoadingType="mask" runat="server" AutoSizePanelID="gridList" />
        <ext:Grid ID="gridList" runat="server" AllowPaging="true" PageSize="50" ForceFitAllTime="true"
            EmptyText="暂时没有相关数据!" DataKeyNames="smId" ShowBorder="false" EnableRowNumber="true"
            AutoScroll="true" ShowHeader="false" EnableCheckBoxSelect="true" OnRowDataBound="gridDataList_RowDataBound">
            <Columns>
                <ext:BoundField ID="bfMenuName" runat="server" DataField="smName" HeaderText="菜单名"
                    Width="120" />
                <ext:BoundField ID="bfMenuCode" runat="server" DataField="smCode" HeaderText="编号" />
                <ext:BoundField ID="bfMenuUrl" runat="server" DataField="smUrl" HeaderText="链接" Width="240" />
                <ext:TemplateField ID="tfUpMenuName" runat="server" HeaderText="上级菜单">
                    <ItemTemplate>
                        <ext:Label ID="lbUpMenuName" runat="server" Text='<%# Eval("smUpCode") %>'>
                        </ext:Label>
                    </ItemTemplate>
                </ext:TemplateField>
                <ext:CheckBoxField ID="cbfMenuStatus" runat="server" DataField="smStatus" HeaderText="状态"
                    Width="40" TextAlign="center" />
                <ext:BoundField ID="bfMenuOrder" runat="server" DataField="smOrder" HeaderText="排序"
                    TextAlign="center" Width="40" />
            </Columns>
            <Toolbars>
                <ext:Toolbar ID="tlMenuAction" runat="server" Position="top">
                    <Items>
                        <ext:Label ID="lblShowTitle" runat="server" Text="系统菜单列表">
                        </ext:Label>
                        <ext:ToolbarFill ID="ToolbarFill2" runat="server">
                        </ext:ToolbarFill>
                        <ext:Label ID="lblAlterInfo" runat="server" Text="友情提示：若选中项时“新增（编辑）菜单”则编辑选中项，否则为新增菜单！"
                            CssStyle="color:red">
                        </ext:Label>
                        <ext:Button ID="btnAddMenu" runat="server" Text="新增（编辑）菜单" Icon="Add" OnClick="btnAddMenu_Click">
                        </ext:Button>
                        <ext:Button ID="btnDeleteMenu" runat="server" Text="删除选中" Icon="delete" OnClick="btnDeleteMenu_Click">
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </Toolbars>
            <PageItems>
                <ext:Button ID="btnRefresh" runat="server" Icon="arrowrefresh" OnClick="btnRefresh_Click"></ext:Button>
                <ext:ToolbarFill ID="ToolbarFill3" runat="server"></ext:ToolbarFill>
                <ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
                </ext:ToolbarSeparator>
                <ext:ToolbarText ID="ToolbarText2" runat="server" Text="每页记录数：">
                </ext:ToolbarText>
                <ext:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
                    OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
                    <ext:ListItem Text="15" Value="15" />
                    <ext:ListItem Text="20" Value="20" />
                    <ext:ListItem Text="25" Value="25" Selected="true" />
                </ext:DropDownList>
            </PageItems>
        </ext:Grid>
        <ext:Window ID="winMenu" runat="server" Title="系统菜单管理" Width="400" AutoHeight="true"
            Popup="false" EnableCollapse="true" CloseAction="HideRefresh">
            <Items>
                <ext:SimpleForm ID="sfMenu" runat="server" Title="管理系统菜单" BodyPadding="10px" LabelAlign="right"
                    AutoHeight="true" ShowHeader="false" FooterBarAlign="center">
                    <Items>
                        <ext:HiddenField ID="hfMenuId" runat="server">
                        </ext:HiddenField>
                        <ext:DropDownList ID="ddlParentMenu" runat="server" EnableEdit="true" Label="选择上级菜单"
                            EnableSimulateTree="true">
                            <ext:ListItem Text="顶级菜单" Value="0" />
                        </ext:DropDownList>
                        <ext:TextBox ID="txtMenuName" runat="server" Label="菜单名称" Required="true">
                        </ext:TextBox>
                        <ext:TextBox ID="txtMenuCode" runat="server" Label="编号" Required="true">
                        </ext:TextBox>
                        <ext:TextBox ID="txtMenuUrl" runat="server" Label="菜单链接" Required="true">
                        </ext:TextBox>
                        <ext:TextBox ID="txtMenuOrder" runat="server" Label="排序" Regex="^\d" Required="true">
                        </ext:TextBox>
                        <ext:CheckBox ID="cboxMenuStatus" runat="server" Label="状态" Text="启用/锁定">
                        </ext:CheckBox>
                    </Items>
                    <Toolbars>
                        <ext:Toolbar ID="tbButton" runat="server" Position="footer">
                            <Items>
                                <ext:ToolbarFill ID="ToolbarFill1" runat="server">
                                </ext:ToolbarFill>
                                <ext:Button ID="btnSubmit" runat="server" Text="保存" Icon="systemsave" ValidateForms="sfMenu"
                                    ValidateTarget="self" OnClick="btnSubmit_Click">
                                </ext:Button>
                                <ext:Button ID="btnReset" runat="server" Text="重置" Icon="reload">
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </Toolbars>
                </ext:SimpleForm>
            </Items>
        </ext:Window>
    </form>
</body>
</html>
